pending_motion_device != event->event.motion.device)
break;
+ if (!event->event.motion.window->event_compression)
+ break;
+
pending_motion_window = event->event.motion.window;
pending_motion_device = event->event.motion.device;
pending_motions = tmp_list;
window->accept_focus = TRUE;
window->focus_on_map = TRUE;
+ window->event_compression = TRUE;
if (attributes_mask & GDK_WA_X)
x = attributes->x;
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_focus_on_map (window, focus_on_map);
}
+/**
+ * gdk_window_set_event_compression:
+ * @window: a #GdkWindow
+ * @event_compression: %TRUE if motion events should be compressed
+ *
+ * Determines whether or not extra unprocessed motion events in
+ * the event queue can be discarded. If %TRUE only the most recent
+ * event will be delivered.
+ *
+ * Some types of applications, e.g. paint programs, need to see all
+ * motion events and will benefit from turning off event compression.
+ *
+ * By default, event compression is enabled.
+ *
+ * Since: 3.12
+ **/
+void
+gdk_window_set_event_compression (GdkWindow *window,
+ gboolean event_compression)
+{
+ g_return_if_fail (GDK_IS_WINDOW (window));
+
+ window->event_compression = event_compression;
+}
+
+/**
+ * gdk_window_get_event_compression:
+ * @window: a #GdkWindow
+ *
+ * Get the current event compression setting for this window.
+ *
+ * Return value: %TRUE if motion events will be compressed
+ *
+ * Since: 3.12
+ **/
+gboolean
+gdk_window_get_event_compression (GdkWindow *window)
+{
+ g_return_val_if_fail (GDK_IS_WINDOW (window), TRUE);
+
+ return window->event_compression;
+}
+
/**
* gdk_window_set_icon_list:
* @window: The #GdkWindow toplevel window to set the icon of.
void gdk_window_set_opaque_region (GdkWindow *window,
cairo_region_t *region);
+GDK_AVAILABLE_IN_3_12
+void gdk_window_set_event_compression (GdkWindow *window,
+ gboolean event_compression);
+GDK_AVAILABLE_IN_3_12
+gboolean gdk_window_get_event_compression (GdkWindow *window);
+
G_END_DECLS
#endif /* __GDK_WINDOW_H__ */